//
//  WJPNavigationController.m
//  DuiTang--
//
//  Created by 万贾平 on 16/9/29.
//  Copyright © 2016年 jpw. All rights reserved.
//

#import "WJPNavigationController.h"

@interface WJPNavigationController ()<UIGestureRecognizerDelegate>

@end

@implementation WJPNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self fullScreenScrollBack];
}
#pragma mark - 全屏滑动返回
-(void)fullScreenScrollBack{
    id target = self.interactivePopGestureRecognizer.delegate;
    UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)];
    [self.view addGestureRecognizer:pan];
    pan.delegate = self;
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
    return self.childViewControllers.count > 1;
}
#pragma mark - push时隐藏tabbar
-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.childViewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:animated];
}

@end
